<%@ Import Namespace="System.IO" %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 7.0">
</HEAD>
<BODY>

<%
	dim myfile as StreamReader
	dim name as string

	myfile = File.OpenText( Server.MapPath("names.txt") )

	name = myfile.ReadLine()

	do while not name is nothing 
		Response.Write( name & "<BR>" )
		name = myfile.ReadLine()
	loop

	myfile.Close()


'	dim books as StreamWriter

 '   books = File.CreateText( Server.MapPath("books.txt") )

'	books.WriteLine("Professional ASP.NET")
'	books.WriteLine("Professional C#")
'	books.Close()


	dim books2 as FileStream

	books2 = new FileStream( Server.MapPath("books.txt"), FileMode.Open )

	Response.Write( books2.Position )
	Response.Write( "<BR>" )
	Response.Write( books2.ReadByte() )
	Response.Write( "<BR>" )

	Response.Write( books2.Position )
	Response.Write( "<BR>" )
	Response.Write( books2.ReadByte() )
	Response.Write( "<BR>" )

	Response.Write( books2.Position )
	Response.Write( "<BR>" )
	Response.Write( books2.ReadByte() )
	Response.Write( "<BR>" )

	Response.Write( books2.Position )
	Response.Write( "<BR>" )
	Response.Write( books2.ReadByte() )
	Response.Write( "<BR>" )

	Response.Write( books2.Position )
	Response.Write( "<BR>" )
	Response.Write( books2.ReadByte() )
	Response.Write( "<BR>" )

	Response.Write( books2.Position )
	Response.Write( "<BR>" )
	Response.Write( books2.ReadByte() )
	Response.Write( "<BR>" )


	dim memstream as MemoryStream
	dim writer as StreamWriter

	dim array() as Byte
	
	Response.Write("<HR>")
	memstream = new MemoryStream()

	dim i as integer

	writer = new StreamWriter( memstream )

	for i = 1 to 10
		writer.Write("Professional ASP.NET")
		writer.Flush()
		Response.Write( memstream.Capacity & ":")
		Response.Write( memstream.Position & "<BR>")
	next 

	memstream.Capacity = 2000
		Response.Write( memstream.Capacity & ":")
		Response.Write( memstream.Position & "<BR>")
	memstream.Capacity = 1000
	array = memstream.ToArray()
	writer.Close()





'	dim backingStore as FileStream

'	backingStore = CType(myfile.BaseStream,FileStream)
'	backingStore.Seek(0,SeekOrigin.Begin)


%>

</BODY>
</HTML>
